import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Code
{
  public static void main (String[] args) throws java.lang.Exception
  {
      Scanner sc = new Scanner(System.in);
      System.out.println("Enter size of Array : ");
      int n;
      
      try{
          n = sc.nextInt();
          if(n < 0){
              throw new Exception("Exception - Array Index is negative");
          }
          int[] arr = new int[n];
          
          System.out.print("Enter Elements : ");
          for(int i = 0; i < n; ++i){
              arr[i] = sc.nextInt();
          }
          
          System.out.print("Array Elements : ");
          for(int i = 0; i < n; ++i){
              System.out.print(arr[i] + " ");
          }
      }
      catch(Exception e){
          System.out.println("Exception Caught");
          System.out.println(e);
      }
      
  }
}
